package cn.cn.day14;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class TestList {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();

        list.add("大力娃");
        list.add("千顺娃");
        list.add("头铁娃");
        list.add("喷火娃");
        list.add("喷水娃");
        list.add("隐身娃");
        list.add("小紫娃");
        //System.out.println(list);
        method(list);

    }

    private static void method(List<String> list) {
        /*for(int i=0;i<=list.size()-1;i++){
            System.out.println(list.get(i));
        }*/

        /*for(String aa:list){
            System.out.println(aa);
        }*/



        Iterator<String> aa=list.iterator();
        while (aa.hasNext()){
            System.out.println(aa.next());
        }
        list.add("爷爷");

        System.out.println(list.contains("喷火娃"));
        System.out.println(list.hashCode());
        System.out.println(list.isEmpty());
        System.out.println(list.remove("爷爷"));
        System.out.println(list);
        System.out.println(list.size());
        Object[] a=list.toArray();
        System.out.println(a);
        List list2= Arrays.asList(a.clone());
       // List list2= Arrays.asList(a.clone());
        System.out.println(list2);

    }
}
